package org.truenewx.tnxjee.repo.redis.support;

import org.truenewx.tnxjee.core.util.ClassUtil;
import org.truenewx.tnxjee.repo.cache.SimpleCacheRepo;

public abstract class RedisSimpleCacheRepoSupport<K, V> extends RedisCacheRepoSupport<V, K>
        implements SimpleCacheRepo<K, V> {

    @Override
    protected Class<K> getKeyClass() {
        return ClassUtil.getActualGenericType(getClass(), 0);
    }

    @Override
    protected Class<V> getValueClass() {
        return ClassUtil.getActualGenericType(getClass(), 1);
    }

    @Override
    public void save(K key, V value) {
        getAccessTemplate().set(key, value);
    }

}
